import { RouteRecordRaw } from "vue-router";
import { HOME_URL, LOGIN_URL } from "@/config/config";
/* Layout */
import Layout from '@/layouts/index.vue'
/**
 * staticRouter(静态路由)
 */
export const staticRouter: Menu.MenuOptions[] = [
	{
		path: "/",
		redirect: HOME_URL,
		hidden: true
	},
	{
		path: LOGIN_URL,
		name: "login",
		hidden: true,
		component: () => import("@/views/login/index.vue"),
		meta: {
			title: "登录"
		}
	},
	{
		path: '/redirect',
		component: Layout,
		hidden: true,
		children: [
		  {
			path: '/redirect/:path(.*)',
			component: () => import('@/views/redirect.vue')
		  }
		]
	  },
	{
		path: "/index",
		name: "index",
		component: Layout,
		redirect: '/dashboard',
		children: [{
			path: '/dashboard',
			name: 'Dashboard',
			component: () => import('@/views/index.vue'),
			meta: { title: '首页', icon: 'home',affix: true}
		}]
	},
];

/**
 * errorRouter(错误页面路由)
 */
export const errorRouter = [
	{
		path: "/403",
		name: "403",
		hidden: true,
		component: () => import("@/components/ErrorMessage/403.vue"),
		meta: {
			title: "403页面"
		}
	},
	{
		path: "/404",
		name: "404",
		hidden: true,
		component: () => import("@/components/ErrorMessage/404.vue"),
		meta: {
			title: "404页面"
		}
	},
	{
		path: "/500",
		name: "500",
		hidden: true,
		component: () => import("@/components/ErrorMessage/500.vue"),
		meta: {
			title: "500页面"
		}
	}
];

/**
 * notFoundRouter(找不到路由)
 */
export const notFoundRouter = {
	path: "/:pathMatch(.*)*",
	name: "notFound",
	redirect: { name: "404" }
};
